import request from '@/utils/request'

// 首页计算数据
export function getCount() {
  return request({
    url: '/front/getCount',
    method: 'get'
  })
}


// 事项列表
export function listApp() {
  return request({
    url: '/front/listApp',
    method: 'get'
  })
}

//用户列表
export function listUser(query) {
  return request({
    url: '/front/listUser',
    method: 'get',
    params: query
  })
}


// 查询事项详情
export function getApp(appId) {
  return request({
    url: '/front/getApp/' + appId,
    method: 'get'
  })
}

// 查询表单详情
export function getForm(formId) {
  return request({
    url: '/front/getForm/' + formId,
    method: 'get'
  })
}

// 查询事项版本详情
export function getAppVersion(appVersionId) {
  return request({
    url: '/front/getAppVersion/' + appVersionId,
    method: 'get'
  })
}

// 查询事项版本配置详情
export function getBpmnConfig(appVersionId) {
  return request({
    url: '/front/getBpmnConfig/' + appVersionId,
    method: 'get'
  })
}

// 查询表单版本详情
export function getFormVersion(formVersionId) {
  return request({
    url: '/front/getFormVersion/' + formVersionId,
    method: 'get'
  })
}


// 查询提交数据详情
export function getDataByInstId(procInstId) {
  return request({
    url: '/front/getDataByInstId/' + procInstId,
    method: 'get'
  })
}

// 查询提交数据详情
export function getFormDataByInstId(procInstId) {
  return request({
    url: '/front/getFormDataByInstId/' + procInstId,
    method: 'get'
  })
}

// 查询岗位列表
export function listPost(query) {
  return request({
    url: '/front/listPost',
    method: 'get',
    params: query
  })
}

export function getFormAndTable(formId) {
  return request({
    url: '/front/getFormAndTable/'+ formId,
    method: 'get',
  })
}

export function getTableData(formId,pageNum,pageSize,data) {
  return request({
    url: '/front/getTableData/' + formId + '/'+ pageNum + '/'+ pageSize,
    method: 'post',
    data: data
  })
}

export function getTableDataById(formId,dataId) {
  return request({
    url: '/front/getTableDataById/'+ formId + '/'+ dataId,
    method: 'get',
  })
}
